<template>
  <div>
    <el-button @click="openq8dd52">q8dd52-edit</el-button>
    <q8dd42-edit
      :visible="addDialogOne.visible"
      :title="addDialogOne.title"
      :data="addDialogOne.data"
      @reset-table="(id:string) => (id?.length ? getTableList() : reset())"
      :is-readonly="addDialogOne.isReadonly"
      @change-visible="changeVisible"
    />
  </div>
</template>
<script setup lang="ts">
import { useTable, useDownload, useDictionary } from "@/utils/useTable";
import request from "@/utils/request";
import { useDictStoreHook } from "@/store/modules/dictionary"; // 引入
import dayjs from "dayjs";
const dictionaryStore = useDictStoreHook();
const openq8dd52 = () => {
  addDialogOne.title = "填报";
  addDialogOne.isReadonly = true;
  addDialogOne.visible = true;
  addDialogOne.data = { id: "3333" };

  // getD52();
};

const addDialogOne = reactive({
  visible: false,
  isReadonly: false,
  title: "",
  data: {},
});
const getTableList = () => {
  console.log(1);
};
const reset = () => {
  console.log(2);
};

//获取业务信息D71
const getD52 = async (id: string) => {
  const res = await request({
    url: "/qms/q8dd51/getD51",
    method: "post",
    data: {
      qualityExceptionId: "3333",
    },
  });
  addDialogOne.data = res.data;
  addDialogOne.title = "填报";
  addDialogOne.isReadonly = false;
  addDialogOne.visible = true;
};
function changeVisible(value: boolean) {
  addDialogOne.visible = value;
  if (!value) {
    addDialogOne.data = {};
  }
}
</script>
<style scoped lang="scss"></style>
